/** Layout */
import Layout from '@/layout'
/**
 * 根据用户权限动态加载的路由
 * 配置参数见https://panjiachen.github.io/vue-element-admin-site/zh/guide/#%E5%8A%9F%E8%83%BD
 */
export const asyncRoutes = [{
        path: '/',
        component: Layout,
        redirect: '/data',
        permissions: ["system:data-table-menu:access"],
        name: 'Root',
        children: [{
            path: 'data',
            name: 'data',
            component: () =>
                import ('@/views/dashboard/index'),
            meta: {
                title: '数据看板',
                permissions: ["system:data-table-menu:access"],
                icon: 'dashboard',
                affix: false
            }
        }]
    },
    {
        path: '/project',
        component: Layout,
        name: "ProcessManagement",
        meta: {
            title: '进件管理',
            permissions: ["system:project-manage-menu:access"],
            icon: 'project'
        },
        children: [{
            path: 'index',
            name: 'Project',
            component: () =>
                import ('@/views/project/index'),
            meta: {
                title: '待进件列表',
                permissions: ["system:project-list-menu:access"],
                icon: 'list'
            }
        },{
            path: 'approvalProject',
            name: 'ApprovalProject',
            component: () =>
                import ('@/views/project/approvalProject'),
            meta: {
                title: '已进件列表',
                permissions: ["system:project-list-menu:access"],
                icon: 'list'
            }
        },
            {
                path: 'sendBack',
                name: 'sendBack',
                component: () =>
                    import ('@/views/project/sendBack'),
                meta: {
                    title: '退件库',
                    permissions: ["system:approval-result-menu:access"],
                    icon: 'return'
                }
            },
            {
                path: 'approvalResult',
                name: 'approvalResult',
                hidden:true,
                component: () =>
                    import ('@/views/project/approvalResult'),
                meta: {
                    title: '审批结果',
                    permissions: ["system:approval-result-menu:access"],
                    icon: 'result'
                }
            },
            {
                path: 'add',
                name: 'add',
                hidden: true,
                component: () =>
                    import ('@/views/project/add'),
                meta: {
                    title: '房抵贷提交进件',
                    permissions: ["system:project-list-menu:access"],
                    icon: 'form'
                }
            },
            {
                path: 'addCredit',
                name: 'addCredit',
                hidden: true,
                component: () =>
                    import ('@/views/credit/add'),
                meta: {
                    title: '信用贷提交进件',
                    permissions: ["system:credit-loan-submit-project:access"],
                    icon: 'form'
                }
            },
            {
                path: 'add_dg',
                name: 'add_dg',
                hidden: true,
                component: () =>
                    import ('@/views/project/add_dg'),
                meta: {
                    title: '提交进件',
                    permissions: ["system:project-list-menu:access"],
                    icon: 'form'
                }
            },
            {
                path: 'edit',
                name: 'edit',
                hidden: true,
                component: () =>
                    import ('@/views/project/detail'),
                meta: {
                    title: '编辑进件',
                    // permissions: ["system:project-list-menu:access:add"],
                    icon: 'form'
                }
            },
            {
                path: 'edit_dg',
                name: 'edit_dg',
                hidden: true,
                component: () =>
                    import ('@/views/project/detail_dg'),
                meta: {
                    title: '编辑进件',
                    // permissions: ["system:project-list-menu:access:add"],
                    icon: 'form'
                }
            },
            {
                path: 'ev',
                name: 'ev',
                hidden: true,
                component: () =>
                    import ('@/views/project/evHouse'),
                meta: {
                    title: '房产评估',
                    // permissions: ["system:project-list-menu:access:add"],
                    icon: 'form'
                }
            },
        ]
    },
    {
        path: '/task',
        component: Layout,
        name: "TaskManagement",
        meta: {
            title: '任务管理',
            permissions: ["system:task-manage-menu:access"],
            icon: 'task'
        },
        children: [{
                path: 'task_list',
                name: 'task_list',
                hidden:true,
                component: () =>
                    import ('@/views/task/taskList'),
                meta: {
                    title: '任务列表',
                    permissions: ["system:task-list-menu:access"],
                    icon: 'list'
                }
            },{
                path: 'pending_list',
                name: 'pending_list',
                component: () =>
                    import ('@/views/task/pending'),
                meta: {
                    title: '待处理任务',
                    permissions: ["system:task-list-menu:access"],
                    icon: 'pending'
                }
            },{
                path: 'processed_list',
                name: 'processed_list',
                component: () =>
                    import ('@/views/task/processed'),
                meta: {
                    title: '已处理任务',
                    permissions: ["system:task-list-menu:access"],
                    icon: 'processed'
                }
            },
            {
                path: 'rejectList',
                name: 'rejectList',
                component: () =>
                    import ('@/views/task/rejectList'),
                meta: {
                    title: '拒件库',
                    permissions: ["system:project-reject-menu:access"],
                    icon: 'reject'
                }
            },
            {
                path: 'deal_credit',
                name: 'DealCredit',
                hidden: true,
                component: () =>
                    import ('@/views/task/credit_loan/deal'),
                meta: {
                    title: '审批任务',
                    // permissions: ["system:project-aaa-menu:access"],
                    icon: 'user'
                }
            },

        ]
    },
    {
        path: '/detail',
        component: Layout,
        name: "TaskManagement",
        meta: {
            title: '任务详情',
            // permissions: ["system:task-manage-menu:access"],
            icon: 'task'
        },
        hidden: true,
        children: [{
                path: 'deal',
                name: 'Deal',
                hidden: true,
                component: () =>
                    import ('@/views/task/deal'),
                meta: {
                    title: '审批任务',
                    // permissions: ["system:user-menu:access"],
                    icon: 'user'
                }
            },{
                path: 'deal_dg',
                name: 'DealDg',
                hidden: true,
                component: () =>
                    import ('@/views/task/deal_dg'),
                meta: {
                    title: '审批任务',
                    // permissions: ["system:user-menu:access"],
                    icon: 'user'
                }
            },
            {
                path: 'projectDetail',
                name: 'projectDetail',
                hidden: true,
                component: () =>
                    import ('@/views/task/deal'),
                meta: {
                    title: '项目详情',
                    // permissions: ["system:user-menu:access"],
                    icon: 'user'
                }
            }
        ]
    },

  /*后期需修改全选控制*/
  {
    path: '/creditLoan',
    component: Layout,
    name: "creditLoan",
    hidden:true,
    meta: {
      title: '信用贷',
      permissions: ["system:task-history-menu:access"],
      icon: 'task'
    },
    children: [
        {
        path: 'listHistory',
        name: 'listHistory',
        component: () =>
          import ('@/views/task/credit_loan/listHistory'),
        meta: {
          title: '审批历史',
          permissions: ["system:credit-loan-list-history-list:access"],
          icon: 'list'
        }
      },
      {
        path: 'dataReview',
        name: 'dataReview',
        component: () =>
          import ('@/views/task/credit_loan/dataReview'),
        meta: {
          title: '资料复核',
          permissions: ["system:credit-loan-data-review:access"],
          icon: 'list'
        }
      },
      {
        path: 'confirmWhiteList',
        name: 'confirmWhiteList',
        component: () =>
          import ('@/views/task/credit_loan/confirmWhiteList'),
        meta: {
          title: '确认白名单',
          permissions: ["system:credit-loan-confirm-white-list:access"],
          icon: 'list'
        }
      },
      {
        path: 'appReview',
        name: 'appReview',
        component: () =>
          import ('@/views/task/credit_loan/appReview'),
        meta: {
          title: 'app审核',
          permissions: ["system:credit-loan-app_review:access"],
          icon: 'list'
        }
      },
      {
        path: 'signReview',
        name: 'signReview',
        component: () =>
          import ('@/views/task/credit_loan/signReview'),
        meta: {
          title: '签约面签',
          permissions: ["system:credit-loan-sign_review:access"],
          icon: 'list'
        }
      },
      {
        path: 'finalApproval',
        name: 'finalApproval',
        component: () =>
          import ('@/views/task/credit_loan/finalApproval'),
        meta: {
          title: '终审结果',
          permissions: ["system:credit-loan-final_approval:access"],
          icon: 'list'
        }
      },
      {
        path: 'confirmDrawMoney',
        name: 'confirmDrawMoney',
        component: () =>
          import ('@/views/task/credit_loan/confirmDrawMoney'),
        meta: {
          title: '提款确认',
          permissions: ["system:credit-loan-draw_confirm_money:access"],
          icon: 'list'
        }
      }
    ]
  },

    {
        path: '/repay',
        component: Layout,
        name: "RepayManagement",
        alwaysShow: true,
        meta: {
            title: '贷后管理',
            permissions: ["system:project-loan-after-manage-menu:access"],
            icon: 'load'
        },
        children: [{
                path: 'repayList',
                name: 'repayList',
                component: () =>
                    import ('@/views/repay/repayList'),
                meta: {
                    title: '还款计划管理',
                    permissions: ["system:repay-plan-manage-menu:access"],
                    icon: 'list'
                }
            },
          {
            path: 'repayPlan',
            name: 'RepayPlan',
            hidden: true,
            component: () =>
              import ('@/views/repay/repayPlan'),
            meta: {
              title: '还款管理',
              permissions: ["system:project-repay-manage:access"],
              icon: 'list'
            }
          }
        ]
    },
    {
        path: '/channel',
        component: Layout,
        name: "ChannelManagement",
        meta: {
            title: '渠道管理',
            permissions: ["system:channel-manage-menu:access"],
            icon: 'channel'
        },
        children: [{
                path: 'list',
                name: 'list',
                component: () =>
                    import ('@/views/channel/index'),
                meta: {
                    title: '渠道列表',
                    permissions: ["system:channel-list-menu:access"],
                    icon: 'list'
                }
            },
            {
                path: 'add',
                name: 'add',
                component: () =>
                    import ('@/views/channel/addChannel'),
                meta: {
                    title: '新增渠道',
                    permissions: ["system:channel-add-menu:access"],
                    icon: 'add'
                }
            }
        ]
    },
    {
        path: '/account',
        component: Layout,
        name: "AccountManagement",
        alwaysShow: true,
        meta: {
            title: '台账管理',
            permissions: ["system:account-manage-menu:access"],
            icon: 'account'
        },
        children: [{
                path: 'list',
                name: 'list',
                component: () =>
                    import ('@/views/account/index'),
                meta: {
                    title: '房抵贷台账',
                    permissions: ["system:account-list-menu:access"],
                    icon: 'accountdown'
                }
            },
          {
            path: 'creditStandIndex',
            name: 'creditStandIndex',
            component: () =>
              import ('@/views/account/creditStandIndex'),
            meta: {
              title: '信用贷台账',
              permissions: ["system:account-list-menu:access"],
              icon: 'accountdown'
            }
          }
        ]
    },
    {
        path: '/messages',
        component: Layout,
        name: "MessageManagement",
        hidden: true,
        meta: {
            title: '消息通知',
            // permissions: ["system:notice-manage-menu:access"],
            icon: 'menu'
        },
        children: [{
            path: 'notice',
            name: 'notice',
            component: () =>
                import ('@/views/sys/notice/index'),
            meta: {
                title: '消息列表',
                // permissions: ["system:notice-manage-list:access"],
                icon: 'user'
            }
        }]
    },
    {
        path: '/log',
        component: Layout,
        name: "Log",
        meta: {
            title: '日志管理',
            permissions: ["system:log-menu:access"],
            icon: 'log'
        },
        children: [{
            path: 'smsLog',
            name: 'smsLog',
            component: () =>
                import ('@/views/sys/log/smsLog'),
            meta: {
                title: '短信日志',
                permissions: ["system:sms-log-menu:access"],
                icon: 'log-short'
            }
        }, {
            path: 'projectLog',
            name: 'projectLog',
            component: () =>
                import ('@/views/sys/log/projectLog'),
            meta: {
                title: '项目日志',
                permissions: ["system:project-log-menu:access"],
                icon: 'log-system'
            }
        },{
            path: 'evLog',
            name: 'evLog',
            component: () =>
              import ('@/views/sys/log/evLog'),
            meta: {
              title: '评估日志',
              permissions: ["system:ev-log-menu:access"],
              icon: 'log-ev'
            }
          }]
    },
    {
        path: '/permision',
        component: Layout,
        name: "PermissionManagement",
        meta: {
            title: '权限管理',
            permissions: ["system:persmisss-manage-menu:access"],
            icon: 'permision'
        },
        children: [{
            path: 'dept',
            name: 'dept',
            component: () =>
                import ('@/views/permission/dept/index'),
            meta: {
                title: '组织架构',
                permissions: ["system:dept-manage-menu:access"],
                icon: 'org1'
            }
        },{
            path: 'org',
            name: 'org',
            component: () =>
                import ('@/views/permission/orgIndex'),
            meta: {
                title: '机构管理',
                icon: 'org2'
            }
        },
          {
            path: 'orgProcess',
            name: 'orgProcess',
            hidden: true,
            component: () =>
              import ('@/views/permission/org/orgProcess'),
            meta: {
              title: '流程管理',
              icon: 'orgProcess'
            }
          },
            {
                path: 'deptUserIndex',
                name: 'deptUserIndex',
                hidden: true,
                component: () =>
                    import ('@/views/permission/dept/deptUserIndex'),
                meta: {
                    title: '员工管理',
                    permissions: ["system:dept-user-manage-menu:access"],
                    icon: 'form'
                }
            },
            {
                path: 'user',
                name: 'User',
                component: () =>
                    import ('@/views/permission/user/index'),
                meta: {
                    title: '系统用户',
                    permissions: ["system:user-manage-menu:access"],
                    icon: 'user'
                }
            },
            {
                path: 'role',
                name: 'Role',
                component: () =>
                    import ('@/views/permission/role/roleList'),
                meta: {
                    title: '角色管理',
                    permissions: ["system:role-menu:access"],
                    icon: 'role'
                }
            },
            // {
            //     path: 'roleList',
            //     name: 'roleList',
            //     component: () =>
            //         import ('@/views/permission/role/index'),
            //     meta: {
            //         title: '角色管理',
            //         permissions: ["system:role-menu:access"],
            //         icon: 'role'
            //     }
            // },
            {
                path: 'permission',
                name: 'Permission',
                component: () =>
                    import ('@/views/permission/permission/index'),
                meta: {
                    title: '权限列表',
                    permissions: ["system-permission-menu:access"],
                    icon: 'permision-list'
                }
            },
            {
                path: 'resource',
                name: 'Resource',
                hidden: true,
                component: () =>
                    import ('@/views/permission/resource/index'),
                meta: {
                    title: '资源管理',
                    permissions: ["system:resource-menu:access"],
                    icon: 'form'
                }
            },
            // {
            //   path: 'permissionTree',
            //   name: 'permissionTree',
            //   hidden: true,
            //   component: () =>
            //     import ('@/views/permission/role/permissionTree'),
            //   meta: {
            //     title: '权限配置',
            //     permissions: ["system:org-menu:access"],
            //     icon: 'form'
            //   }
            // }
        ]
    },
    {
        path: '/system',
        component: Layout,
        name: "SystemManagement",
        alwaysShow: true,
        meta: {
            title: '系统管理',
            permissions: ["system:sys:sys-menu:access"],
            icon: 'system'
        },
        children: [
            {
                path: 'version',
                name: 'Version',
                component: () =>
                    import ('@/views/sys/version'),
                meta: {
                    title: 'App版本管理',
                    permissions: ["system:sys:version-menu:access"],
                    icon: 'appversion'
                }
            },
            {
                path: 'dict',
                name: 'Dict',
                hidden:true,
                component: () =>
                    import ('@/views/sys/dict'),
                meta: {
                    title: '字典管理',
                    permissions: ["system:sys:dict-menu:access"],
                    icon: 'user'
                }
            },
            {
                path: 'monitor',
                name: 'Monitor',
                hidden:true,
                component: () =>
                    import ('@/views/sys/monitor'),
                meta: {
                    title: '系统监控',
                    permissions: ["system:sys:monitor-menu:access"],
                    icon: 'user'
                }
            },
        ]
    },
    {
        path: '/capital',
        component: Layout,
        hidden: false,
        name: "CapitalManagement",
        alwaysShow: true,
        meta: {
            title: '资方管理',
            permissions: ["system:capital-menu:access"],
            icon: 'capital'
        },
        children: [
            {
                path: 'index',
                name: 'index',
                component: () =>
                    import ('@/views/capital/capital'),
                meta: {
                    title: '资方列表',
                    permissions: ["system:capital-list-menu:access"],
                    icon: 'list'
                }
            },
            {
                path: 'product',
                name: 'Product',
                component: () =>
                    import ('@/views/capital/index'),
                meta: {
                    title: '产品列表',
                    permissions: ["system:capital-list-menu:access"],
                    icon: 'list'
                }
            },
        ]
    },
]
